<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
  </head>
  <body>
    <div id="app">
      <input type="text" name="" id="" v-model.number="num1">+<input type="text" name="" id="" v-model.number="num2">=<span>{{res}}</span>
    </div>
    <script src="./vue.js"></script>
    <script>
      const vm=new Vue({
        el:'#app',
        data:{num1:"",num2:"",res:""},
        methods:{},
        watch:{
          num2(){
            this.res=this.num1+this.num2
          },
          num1(){
            this.res=this.num1+this.num2
          }
        }
       })
    </script>
  </body>
</html>